package com.aqgj.SysArea.service;


import com.aqgj.SysArea.bean.SysArea;
import com.aqgj.SysArea.dao.SysAreaDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service("SysArea")
public class SysAreaManager {
    @Autowired
    SysAreaDao sysAreaDao;

    /**
     * 根据pid，区域级别获取行政区域.
     *
     * @param levels 区域级别
     * @param pid    pid上级id
     * @return list
     */
    public List<SysArea> getAreaByPidAndLevel(Integer levels, String pid) {
        return sysAreaDao.getAreaByPidAndLevel(levels, pid);
    }

    public SysArea findUniqueBy(String propertyName, Object value) {
        return sysAreaDao.findUniqueBy(propertyName, value);
    }

    public List<SysArea> findBy(String propertyName, Object value) {
        return sysAreaDao.findBy(propertyName, value);
    }
    public SysArea get(String id) { return sysAreaDao.get(id);}

}
